import request from '@/utils/request'

// 查询房间档案列表
export function listRoom(query) {
  return request({
    url: '/base/room/list',
    method: 'get',
    params: query
  })
}

// 查询房间档案详细
export function getRoom(id) {
  return request({
    url: '/base/room/' + id,
    method: 'get'
  })
}

// 新增房间档案
export function addRoom(data) {
  return request({
    url: '/base/room',
    method: 'post',
    data: data
  })
}

// 修改房间档案
export function updateRoom(data) {
  return request({
    url: '/base/room',
    method: 'put',
    data: data
  })
}

// 删除房间档案
export function delRoom(id) {
  return request({
    url: '/base/room/' + id,
    method: 'delete'
  })
}

// 查询房间树
export function roomTree(params) {
  return request({
    url: '/base/room/tree',
    method: 'get',
    params
  })
}

// 批量修改
export function batchEdit(data) {
  return request({
    url: `/base/room/batchEdit`,
    method: 'put',
    data
  })
}

// 批量设置单价
export function batchPrice(params,data) {
  return request({
    url: `/base/room/batchPrice?eqPrice=${params}`,
    method: 'put',
    data
  })
}

// 更换设备
export function deviceSet(data) {
  return request({
    url: `/base/room/deviceSet`,
    method: 'put',
    data
  })
}

// 更换设备详情
export function getEgDetail(roomId) {
  return request({
    url: `/param/eq/${roomId}`,
    method: 'get',
  })
}
